Fix W32 theme for spinbuttons
authorРуслан Ижбулатов <lrn1986@gmail.com>
Tue, 25 Mar 2014 15:47:56 +0000 (15:47 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Tue, 1 Apr 2014 03:29:34 +0000 (03:29 +0000)
It seems that the dec-button no longer has a "bottom" selector-thingy to
select for. Use "last-child" instead.
Use .vertical to style vertical instance differently, as last-child/first-child
meaning is inverted there.
Increase (towards 0) margins a bit, to avoid clipping the pre-light rectangle.
Use dir(rtl) selector to style horizontal instance differently for RTL locales,
where first-child is "inc".

https://bugzilla.gnome.org/show_bug.cgi?id=727022

gtk/resources/theme/gtk-win32-base.css

index b8474ca2885ea87a9fb583fd79831f2bcf3cb0d5..a845769cc497cb539b72463482aea1bb86eac8ce 100644 (file)
@@ -376,51 +376,141 @@ GtkButton.check:active:prelight {
 .spinbutton .button,
 .spinbutton .button:focused {
     background-color: transparent;
-    background-image: -gtk-win32-theme-part(spin, 1 1, margins(-1 -1 0 -1));
+    background-image: -gtk-win32-theme-part(spin, 2 1, margins(0 -1 -1 -1));
     color: rgba(0, 0, 0, 0);
 }
 
-.spinbutton .button:last-child {
-    background-image: -gtk-win32-theme-part(spin, 1 1, margins(-1 -1 0 -2));
+.spinbutton .button:last-child,
+.spinbutton .button:focused:last-child {
+    background-image: -gtk-win32-theme-part(spin, 1 1, margins(-1 -1 0 -1));
 }
 
 .spinbutton .button:prelight,
 .spinbutton .button:prelight:focused {
+    background-image: -gtk-win32-theme-part(spin, 2 2, margins(0 -1 -1 -1));
+}
+
+.spinbutton .button:prelight:last-child,
+.spinbutton .button:prelight:focused:last-child {
     background-image: -gtk-win32-theme-part(spin, 1 2, margins(-1 -1 0 -1));
 }
 
+
 .spinbutton .button:active,
 .spinbutton .button:active:prelight,
 .spinbutton .button:active:focused,
 .spinbutton .button:active:prelight:focused {
+    background-image: -gtk-win32-theme-part(spin, 2 3, margins(0 -1 -1 -1));
+}
+
+.spinbutton .button:active:last-child,
+.spinbutton .button:active:prelight:last-child,
+.spinbutton .button:active:focused:last-child,
+.spinbutton .button:active:prelight:focused:last-child {
     background-image: -gtk-win32-theme-part(spin, 1 3, margins(-1 -1 0 -1));
 }
 
 .spinbutton .button:insensitive {
-    background-image: -gtk-win32-theme-part(spin, 1 4, margins(-1 -1 0 -1));
+    background-image: -gtk-win32-theme-part(spin, 2 4, margins(0 -1 -1 -1));
 }
 
 .spinbutton .button:insensitive:last-child {
-    background-image: -gtk-win32-theme-part(spin, 1 4, margins(-1 -1 0 -2));
+    background-image: -gtk-win32-theme-part(spin, 1 4, margins(-1 -1 0 -1));
+}
+
+
+
+.spinbutton.vertical .button,
+.spinbutton.vertical .button:focused {
+    background-color: transparent;
+    color: rgba(0, 0, 0, 0);
+    background-image: -gtk-win32-theme-part(spin, 1 1, margins(0 -1 -0 -1));
+}
+
+.spinbutton.vertical .button:last-child,
+.spinbutton.vertical .button:focused:last-child {
+    background-image: -gtk-win32-theme-part(spin, 2 1, margins(0 -1 0 -1));
+}
+
+
+.spinbutton.vertical .button:prelight,
+.spinbutton.vertical .button:prelight:focused {
+    background-image: -gtk-win32-theme-part(spin, 1 2, margins(0 -1 -0 -1));
+}
+
+.spinbutton.vertical .button:prelight:last-child,
+.spinbutton.vertical .button:prelight:focused:last-child {
+    background-image: -gtk-win32-theme-part(spin, 2 2, margins(0 -1 0 -1));
+}
+
+
+.spinbutton.vertical .button:active,
+.spinbutton.vertical .button:active:prelight,
+.spinbutton.vertical .button:active:focused,
+.spinbutton.vertical .button:active:prelight:focused {
+    background-image: -gtk-win32-theme-part(spin, 1 3, margins(0 -1 -0 -1));
+}
+
+.spinbutton.vertical .button:active:last-child,
+.spinbutton.vertical .button:active:prelight:last-child,
+.spinbutton.vertical .button:active:focused:last-child,
+.spinbutton.vertical .button:active:prelight:focused:last-child {
+    background-image: -gtk-win32-theme-part(spin, 2 3, margins(0 -1 0 -1));
+}
+
+.spinbutton.vertical .button:insensitive {
+    background-image: -gtk-win32-theme-part(spin, 1 4, margins(0 -1 -0 -1));
+}
+
+.spinbutton.vertical .button:insensitive:last-child {
+    background-image: -gtk-win32-theme-part(spin, 2 4, margins(0 -1 0 -1));
+}
+
+
+
+.spinbutton .button:dir(rtl),
+.spinbutton .button:focused:dir(rtl) {
+    background-color: transparent;
+    background-image: -gtk-win32-theme-part(spin, 2 1, margins(0 -1 -1 -1));
+    color: rgba(0, 0, 0, 0);
+}
+
+.spinbutton .button:first-child:dir(rtl),
+.spinbutton .button:focused:first-child:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 1 1, margins(-1 -1 0 -1));
+}
+
+.spinbutton .button:prelight:dir(rtl),
+.spinbutton .button:prelight:focused:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 2 2, margins(0 -1 -1 -1));
 }
 
-.spinbutton .button.bottom,
-.spinbutton .button.bottom:focused {
-    background-image: -gtk-win32-theme-part(spin, 2 1);
+.spinbutton .button:prelight:first-child:dir(rtl),
+.spinbutton .button:prelight:focused:first-child:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 1 2, margins(-1 -1 0 -1));
+}
+
+
+.spinbutton .button:active:dir(rtl),
+.spinbutton .button:active:prelight:dir(rtl),
+.spinbutton .button:active:focused:dir(rtl),
+.spinbutton .button:active:prelight:focused:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 2 3, margins(0 -1 -1 -1));
 }
 
-.spinbutton .button.bottom:prelight,
-.spinbutton .button.bottom:prelight:focused {
-    background-image: -gtk-win32-theme-part(spin, 2 2);
+.spinbutton .button:active:first-child:dir(rtl),
+.spinbutton .button:active:prelight:first-child:dir(rtl),
+.spinbutton .button:active:focused:first-child:dir(rtl),
+.spinbutton .button:active:prelight:focused:first-child:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 1 3, margins(-1 -1 0 -1));
 }
 
-.spinbutton .button.bottom:active,
-.spinbutton .button.bottom:active:prelight {
-    background-image: -gtk-win32-theme-part(spin, 2 3);
+.spinbutton .button:insensitive:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 2 4, margins(0 -1 -1 -1));
 }
 
-.spinbutton .button.bottom:insensitive {
-    background-image: -gtk-win32-theme-part(spin, 2 4);
+.spinbutton .button:insensitive:first-child:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 1 4, margins(-1 -1 0 -1));
 }
 
 /* Ranges */